package com.springboot.mapper;

import com.springboot.model.MessageInform;
import org.apache.ibatis.annotations.Mapper;

import java.util.ArrayList;

@Mapper
public interface MessageInformMapper {
    int deleteByPrimaryKey(Integer messageId);

    int insert(MessageInform record);

    int insertSelective(MessageInform record);

    MessageInform selectByPrimaryKey(Integer messageId);

    int updateByPrimaryKeySelective(MessageInform record);

    int updateByPrimaryKey(MessageInform record);

    //根据患者ID查找今天的通知和未读的通知
    ArrayList<MessageInform> selectByPatientId(Integer patientId);

    //根据其余字段查找消息ID
    MessageInform selectMessageId(MessageInform record);

    //<!-- 返回最大massageId !-->
    Integer selectMessageId2();

    //患者一键已读
    int updateAllByPatientId(Integer patientId);

    //返回未读数量
    int selectUnreadNumByPatientId(Integer patientId);


    //通过医生id查找该医生的消息列表
    ArrayList<MessageInform> selectByDoctorId(Integer doctorId);

    //通过记录查找消息
    MessageInform selectByRecord(MessageInform record);

    //通过医生id查找该医生近三天的消息列表
    ArrayList<MessageInform> selectThreeByDoctorId(Integer doctorId);


    MessageInform selectByMessageInform(MessageInform messageInform);

    ArrayList<MessageInform> getAllRecord();
}